package com.codefish.service.impl;

import com.codefish.entity.SysPermissionApiEntity;
import com.codefish.mapper.SysPermissionApiDao;
import com.codefish.service.SysPermissionApiService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * 权限与接口
 *
 * @author codefish
 * @email code_fish@aliyun.com
 * @date 2021-04-15 04:22:58
 */
@Service("sysPermissionApiService")
public class SysPermissionApiServiceImpl extends ServiceImpl<SysPermissionApiDao, SysPermissionApiEntity> implements SysPermissionApiService {

    /**
     * 新增接口
     * @param apiEntity
     * @return
     */
    @Transactional(propagation = Propagation.SUPPORTS,rollbackFor = Exception.class)
    @Override
    public int saveOne(SysPermissionApiEntity apiEntity) {
        boolean save = this.save(apiEntity);
        if (save){
            return 1;
        }
        return 0;
    }
}